﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ANMCMaster.Master" AutoEventWireup="true" CodeBehind="SmallgroupManager.aspx.cs" Inherits="AllNations.WebAppAdmin.SmallgroupManager" %>
<%@ Register src="~/Controls/UserPageLeftNav.ascx" TagName="UserPageLeftNav" TagPrefix="ANMC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ANHeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ANPageHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ANBodyContent" runat="server">
    <div class="leftnav">
        <div style="margin: 11px 0px 25px 0px;"><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/sectionTitleMembership.png" /></div>
        <ANMC:UserPageLeftNav ID="UserPageLeftNav1" runat="server" Selected="SmallgroupManager" />
    </div>
    <div class="rightcontentarea">
        <div id="contentBoxHolder">
            <div class="ContentTitleBar">
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/titleSmallgroupManager.png" />
            </div>
            <telerik:RadMultiPage ID="SmallGroupViews" runat="server" RenderSelectedPageOnly="true" SelectedIndex="0">
                <telerik:RadPageView ID="Listview" runat="server">
                    <telerik:RadGrid ID="gridSmallgroup" runat="server" AllowSorting="true">
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="smallgroup_id" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="새 소그룹 Record" EditFormSettings-EditColumn-ButtonType="ImageButton">
                            <Columns>
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                                <telerik:GridBoundColumn DataField="group_nm" HeaderText="소그룹" />
                                <telerik:GridBoundColumn DataField="group_leader_nm" HeaderText="소그룹 Leader" ColumnEditorID="editorGroupLeaderNm" />
                                <telerik:GridBoundColumn DataField="group_leader_email" HeaderText="Leader Email" ColumnEditorID="editorGroupLeaderEmail" />
                                <telerik:GridBoundColumn DataField="group_leader_phone" HeaderText="Leader Phone" />
                                <telerik:GridBoundColumn DataField="description_txt" HeaderText="비고" ColumnEditorID="editorDescriptionTxt" />
                                <telerik:GridBoundColumn DataField="member_cnt" HeaderText="# of Members" ReadOnly="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
                                <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkEditMember" runat="server" Text="Edit Members" CommandArgument='<%# Eval("smallgroup_id") %>' OnClick="lnkEditMember_Click" />
                                        |
                                        <asp:LinkButton ID="lnkDeleteItem" runat="server" Text="Delete" CommandArgument='<%# Eval("smallgroup_id") %>' OnClick="lnkDeleteItem_Click" OnClientClick="if (!confirm('You are about to delete a small group, click OK to continue.')) return false;" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <telerik:GridTextBoxColumnEditor ID="editorGroupLeaderNm" runat="server" TextBoxStyle-Width="250px" />
                    <telerik:GridTextBoxColumnEditor ID="editorGroupLeaderEmail" runat="server" TextBoxStyle-Width="250px" />
                    <telerik:GridTextBoxColumnEditor ID="editorDescriptionTxt" runat="server" TextBoxMode="MultiLine" TextBoxStyle-Width="400px" TextBoxStyle-Height="75px"/>
                </telerik:RadPageView>
                <telerik:RadPageView ID="EditMemberView" runat="server">
                    <asp:HiddenField ID="hidSelectedSmallgroupId" runat="server" />
                    <div>Edit members for <asp:Label ID="lblSmallGroupName" runat="server" /></div>
                    <telerik:RadGrid ID="gridSmallgroupMember" runat="server">
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="member_id">
                            <Columns>
                                <telerik:GridBoundColumn DataField="username_txt" HeaderText="UserName" />
                                <telerik:GridBoundColumn DataField="firstname_txt" HeaderText="First Name" />
                                <telerik:GridBoundColumn DataField="lastname_txt" HeaderText="Last Name" />
                                <telerik:GridBoundColumn DataField="korean_nm" HeaderText="Korean Name" />
                                <telerik:GridBoundColumn DataField="emailaddr_txt" HeaderText="Email" />
                                <telerik:GridBoundColumn DataField="cellphone_txt" HeaderText="Cell Phone" />
                                <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDeleteMember" runat="server" Text="Delete" CommandArgument='<%# Eval("member_id") %>' OnClick="lnkDeleteMember_Click" OnClientClick="if (!confirm('You are about to delete a small group member, click OK to continue.')) return false;" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <div>Add Member: <asp:DropDownList ID="ddAvailableMembers" runat="server" DataTextField="username_txt" DataValueField="member_id" /><asp:Button ID="btAddMembers" runat="server" Text="Add" OnClick="btAddMembers_Click" /></div>
                    <asp:Button ID="btCancel" runat="server" Text="Back to small group list" OnClick="btCancel_Click" />
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </div>
        <div style="clear: both;"></div>
    </div>
    <div style="clear: both;"></div>
</asp:Content>
